package com.bajiao.dto.store;

import com.alibaba.fastjson.annotation.JSONField;
import com.bajiao.common.util.vans.RegexTool;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.*;
import java.util.Date;

@Data
@ApiModel("StoreApplyStep1Request")
public class StoreApplyStep1Request {

    @NotNull(message = "请选择入驻方式")
    @Range(min = 1, max = 2, message = "请选择有效入驻方式")
    @ApiModelProperty(value = "1-个人 2-企业")
    private Integer type;

    @NotBlank(message = "请填写店铺名称")
    @Length(max = 30, message = "店铺名称过长")
    @ApiModelProperty(value = "店铺名称")
    private String title;

    @NotBlank(message = "请上传店铺Logo")
    @ApiModelProperty(value = "店铺logo")
    private String logoImage;

    @NotBlank(message = "请上传店内图片")
    @ApiModelProperty(value = "店内图片")
    private String insideImages;

    @NotNull(message = "请选择开店时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JSONField(format = "yyyy-MM-dd")
    @ApiModelProperty(value = "开店时间")
    private Date openDate;

    @NotBlank(message = "请选择店铺类型")
    @ApiModelProperty(value = "行业id")
    private String industryId;

    @NotBlank(message = "请选择店铺所在省")
    @ApiModelProperty(value = "店铺所在省")
    private String province;

    @NotBlank(message = "请选择店铺所在城市")
    @ApiModelProperty(value = "店铺所在城市")
    private String city;

    @NotBlank(message = "请选择店铺所在区/县")
    @ApiModelProperty(value = "店铺所在区/县")
    private String district;

    @ApiModelProperty(value = "店铺所在区/县编码")
    private String districtCode;

    @NotBlank(message = "请填写店铺详细地址")
    @ApiModelProperty(value = "店铺详细地址")
    private String address;

    @NotBlank(message = "请填写店铺地址")
    @ApiModelProperty(value = "经度")
    private String longitude;

    @NotBlank(message = "请填写店铺地址")
    @ApiModelProperty(value = "纬度")
    private String latitude;

    @NotBlank(message = "请填写店铺联系电话")
    @Pattern(regexp = RegexTool.mobileRegex, message = "请填写有效的店铺联系电话")
    @ApiModelProperty(value = "店铺联系电话")
    private String storeMobile;

    @NotBlank(message = "请填写店铺简介")
    @Length(max = 200, message = "店铺简介过长")
    @ApiModelProperty(value = "简介")
    private String intro;
}
